/* eslint-disable */
// import md5 from 'md5'
const md5 = require('md5')
function getSign(request) {
    let result = '';
    const { url, header: { timestmap }, body } = request;
    let q = '';
    if (url.indexOf('?') > 0) {
        const path = url.split('?')[0];
        const query = url.split('?')[1];
        q += `${path}${query}`
    } else {
        q += url
    }
    if (Object.keys(body) === 0) {
        q += md5(JSON.stringify(body))
    }
    q += timestmap;
    console.log({ q })
    return md5(q)
}

module.exports = {
    getSign: getSign
}